<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class User</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> User</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">User.php</p>
<p class="description"><p>Class which deals with the registration, login and maintenance of user data</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Jose Oliveira &lt;<a href="mailto:jafo@ua.pt">jafo@ua.pt</a>&gt; 2012</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_serverResources---includes---classes---User.php.html">/serverResources/includes/classes/User.php</a> (line <span class="field">11</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																								<div class="method-definition">
					<img src="../media/images/Constructor.png" alt=" "/>
											<span class="method-result">User</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$password</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$country</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$degree</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$avatar</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#activateUser" title="details" class="method-name">activateUser</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$activationKey</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">integer</span>
										<a href="#addUser" title="details" class="method-name">addUser</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool</span>
										<a href="#deleteUser" title="details" class="method-name">deleteUser</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$email</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getAvatarName" title="details" class="method-name">getAvatarName</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">array</span>
										<a href="#getUser" title="details" class="method-name">getUser</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$email</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">String</span>
										<a href="#getUserDegree" title="details" class="method-name">getUserDegree</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#getUserName" title="details" class="method-name">getUserName</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool</span>
										<a href="#insertedEmailExists" title="details" class="method-name">insertedEmailExists</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#sendNewPasswordLink" title="details" class="method-name">sendNewPasswordLink</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$subject</span>, <span class="var-type">String</span>&nbsp;<span class="var-name">$to</span>, <span class="var-type">String</span>&nbsp;<span class="var-name">$message</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool</span>
										<a href="#updateUserPassword" title="details" class="method-name">updateUserPassword</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$newPassword</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">33</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	
	<div class="method-signature">
		<span class="method-result">User</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$password</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$country</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$degree</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$avatar</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: is the userName</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$email</span><span class="var-description">: is the email of the user</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$password</span><span class="var-description">: is the password of the user</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$country</span><span class="var-description">: is the country of the user</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$degree</span><span class="var-description">: is the school degree of the user</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$avatar</span><span class="var-description">: is one image choosed from the user</span>			</li>
				</ul>
		
			
	</div>
<a name="methodactivateUser" id="activateUser"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">activateUser</span> (line <span class="line-number">490</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method that activates the user account, after he click in the activation link</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			activateUser
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$activationKey</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$email</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$activationKey</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddUser" id="addUser"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">addUser</span> (line <span class="line-number">61</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This method adds new users to the database</p>
<p class="description"><p>Some validations are made, such as, check if the user email is not used by other user  An automatic email is send to the user, with an account activation link</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> return 1: the email is already registed in the database  return 2: an erros occurred in the process of account criation  return 3: the account was created successfully  return 4: this userName already exists  return 5: image extension unknown  return 6: image size exceeds the limit  return 7: an error occurred in the avatar upload</li>
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			addUser
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoddeleteUser" id="deleteUser"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">deleteUser</span> (line <span class="line-number">311</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			deleteUser
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$email</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetAvatarName" id="getAvatarName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getAvatarName</span> (line <span class="line-number">705</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method that returns the avatarName</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getAvatarName
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$userID</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetUser" id="getUser"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getUser</span> (line <span class="line-number">228</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="description"><p>um array com os dados desse utilizador</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getUser
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$email</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetUserDegree" id="getUserDegree"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getUserDegree</span> (line <span class="line-number">284</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method that returns the academic degree by receiving the respective userID</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			getUserDegree
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$userID</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetUserName" id="getUserName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getUserName</span> (line <span class="line-number">256</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method that returns the userName by receiving the respective userID</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getUserName
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$userID</span>			</li>
				</ul>
		
			
	</div>
<a name="methodinsertedEmailExists" id="insertedEmailExists"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">insertedEmailExists</span> (line <span class="line-number">460</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method used to check if an e-mail is already registed in the database</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			insertedEmailExists
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsendNewPasswordLink" id="sendNewPasswordLink"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">sendNewPasswordLink</span> (line <span class="line-number">378</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method that sends an email to the user who wants to change his password</p>
<p class="description"><p>Uso da class PHPMailer</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			sendNewPasswordLink
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$subject</span>, <span class="var-type">String</span>&nbsp;<span class="var-name">$to</span>, <span class="var-type">String</span>&nbsp;<span class="var-name">$message</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$subject</span>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$to</span>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$message</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdateUserPassword" id="updateUserPassword"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">updateUserPassword</span> (line <span class="line-number">342</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Method used to change the user password</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			updateUserPassword
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$newPassword</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$userID</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$newPassword</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$userID</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Fri, 22 Feb 2013 05:34:01 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>